import request from '@/utils/request'

// 根据 ID 更新权限点详情
export function UploadSysPermissionApi (data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

// 根据 ID 获取权限点详情
export function getSysPermissionApi (id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'get'
  })
}

// 根据 ID 删除权限点
export function delSysPermissionApi (id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 添加权限点
export function addSysPermissionApi (data) {
  return request({
    url: `/sys/permission`,
    method: 'POST',
    data
  })
}

// 获取所有权限点
export function getAllPermissionApi () {
  return request({
    url: `/sys/permission`,
    method: 'get'
  })
}
